class Student:
    def __init__(self):
        self.student_id =  1
        self.name = "小名"
        self.age = 18
        self.sex = "男"
        self.height = 180.6
        self.weight = 80.5
        self.score = 100
        self.address = "北京"
        self.phone = "123456789"
    def study(self,time):
        print(f"{self.name}学习了{time}小时")
    def play(self,game_name):
        print(f"{self.name}玩了{game_name}")
    def program(self,line):
        print(f"{self.name}写了{line}行代码")
    def add(self,num1,num2):
        return num1 + num2
print('*'*20)
st = Student()
st.study(3)
st.play("王者荣耀")
st.program(100)
print(f"num1+num2的值是{st.add(1,2)}")
print('*'*20)
class Car:
    def __init__(self,car_model):
        self.car_model = car_model
        self.wheels =  4
        self.color = "red"
        self.weight = 1000
        self.save = 1000000
    def run(self,function):
        print(f"{self.car_model}在{function}跑")
car0 = Car("法拉利")
car1 = Car("宝马")
car2 = Car("铃木")
car3 = Car("五菱")
car4 = Car("拖拉机")
car0.run("越野")
car0.run("赛车")
print('*'*20)
class Notebook:
    def __init__(self):
        self.notebook_id = 1
        self.time = 5
        self.color = "黑色"
        self.weight = 1000
        self.CPU = "i7"
        self.save = 1000000
        self.brand = 2000000
    def work(self,content):
        print(f"型号{self.notebook_id}的{self.color}笔记本正在写{content}")
    def play(self,content):
        print(f"型号{self.notebook_id}的{self.color}笔记本正在玩{content}")
note = Notebook()
note.work("python代码")
note.play("王者荣耀")
print('*'*20)
class Monkey:
    def __init__(self):
        self.monkey_id = 1
        self.name = "小猴"
        self.age = 18
        self.sex = "男"
        self.height = 180.6
        self.weight = 80.5
        self.color = "黑色"
    def study(self,learn):
        print(f"{self.name}学习了{learn}")
    def creat(self,m,g):
        print(f"{self.name}使用{m}和{g}造火")
mon = Monkey()
mon.study("python基础")
mon.creat("木棍","石头")
print('*'*20)